package com.itheima.demo7;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerDemo3 {
    public static void main(String[] args) throws IOException {
        //TCP协议，接收数据

        //1.创建对象ServerSocker
        ServerSocket socket = new ServerSocket(10086);

        while (true) {
            //2.监听客户端的连接
            Socket sc = socket.accept();

            //创建线程
            new Thread(new MyRunnable(sc)).start();

        }


    }
}
